<template>
 <div class="app-container">
    <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="反馈内容">
        <el-input type="textarea" v-model="form.content" maxlength="30" placeholder="请输入反馈内容，不超过30字"></el-input>
    </el-form-item>
    <el-form-item label="反馈类型">
        <el-input v-model="form.type" placeholder="请输入反馈类型"></el-input>
    </el-form-item>
        <el-form-item label="图片地址" prop="pics">
            <upload
                :value="form.pics"
                @uploadSuccess="uploadSuccess"
            ></upload>
        </el-form-item>
    </el-form>
    <div style="float:right">
        <el-button type="primary" @click="submitForm">提 交</el-button>
    </div>
 </div>
</template>

<script>
import {addFeedback} from "@/api/feedback/feedback"
import upload from "@/components/ImageUpload";
export default {
    components: { upload },
    data(){
        return {
        
            form: {
                pics:[]
            },
        }
    },
    methods: {
        submitForm(){
            addFeedback(this.form).then((response) => {
              this.msgSuccess("反馈成功");
              this.form = {}
              console.log(this.form.pics)
            });
        },
        //上传用户头像
        uploadSuccess(url) {
            
             this.form.pics.push(url) ;
             console.log(url);
        },
    }

}
</script>

<style>

</style>